package com.dyoud.api.config;

import javax.annotation.Resource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dyoud.core.code.RedisSmsManager;
import com.dyoud.core.code.SmsManager;
import com.dyoud.message.api.service.SmsMessageService;

import redis.clients.jedis.JedisPool;

@Configuration
public class SmsManagerConfig {

    @Resource
    private JedisPool jedisPool;

    @Reference
    private SmsMessageService smsMessageService;

    @Bean
    public SmsManager smsManager() {
        SmsManager smsManger = new RedisSmsManager(jedisPool, smsMessageService);

        return smsManger;
    }
}
